import Vue from 'vue'
import Router from 'vue-router'
// import Home from './views/Home.vue'

Vue.use(Router)

//暴露组件
import myhome from './components/tabbar/myhome.vue';
import Shopcar from './components/tabbar/Shopcar.vue';
import Search from './components/tabbar/Search.vue';
import Member from './components/tabbar/Member.vue';
//引入新闻页面
import NewsList from './components/news/NewsList.vue';
import NewsInfo from './components/news/NewsInfo.vue';
// 引入图片页面
import PhotoList from './components/photolist/PhotoList.vue';
import PhotoInfo from './components/photolist/PhotoInfo.vue';
//引入商品列表
import GoodShop from './components/goodshop/goodslist.vue';
import GoodsInfo from './components/goodshop/goodsInfo.vue';
import goodsDesc from './components/goodshop/goDesc.vue';
import goodscomment from './components/goodshop/goodscomment.vue';
//引用登录页面
import Login from './components/user/login.vue';
//vuex测试学习页面
import count from './components/demo/count.vue';


export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect:'/myhome'
    },
    {path:'/login',name:'login',component:Login},
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // },
     //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    //底下组件模块
    {path: '/myhome', component: myhome},
    {path: '/Shopcar',name: 'Shopcar', component: Shopcar},
    {path: '/Search',name: 'Search', component: Search},
    { path: '/Member',name: 'Member', component: Member},
    //新闻部分
    { path: '/myhome/newslist', component: NewsList },
    { path: '/myhome/newsinfo/:id', component: NewsInfo },
    //图片部分
    {path:'/myhome/photolist',component:PhotoList},
    {path:'/myhome/photoinfo/:id',component:PhotoInfo},
    //商品列表
    {path:'/myhome/goodshop',component:GoodShop},
    {path:'/myhome/goodsinfo/:id',name:"GoodsInfo",component:GoodsInfo},
    //商品详情页面
    {path:'/myhome/goDesc/:id',name:'goodsDesc',component:goodsDesc},
    {path:'/myhome/goodscomment/:id',name:'goodscomment',component:goodscomment},
    //测试页面
    {path:'/count',name:'count',component:count}
    
  ],
  linkActiveClass:'mui-active'
})
